<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AlterVulsRecord20171208 extends Migration
{
    /**
     * 对表 Vuls_records增加字段，is_reasonable =>判断等级是否合理
     *
     * @return void
     */
    public function up()
    {
        Schema::table('vuls_record', function (Blueprint $table) {
            $table->tinyInteger('is_reasonable')->default(0)->comment('判断等级是否合理,默认0,1：待评判,2：合理,3：不合理');
            $table->tinyInteger('reward')->default(0)->comment('安全币');
            $table->tinyInteger('credit')->default(0)->comment('积分');
        });

    }

    /**
     * 回滚删除
     *
     * @return void
     */
    public function down()
    {
        Schema::table('vuls_record', function (Blueprint $table) {
            $table->dropColumn(['is_reasonable','reward','credit']);
        });
    }
}
